/*
Copyright 2007 Stuart Maier.
This file is part of The Neural Network Compiler.

The Neural Network Compiler is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

The Neural Network Compiler is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with The Neural Network Compiler.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdio.h>

int main(int argc, char *argv[])
{
	/* Check if we specified a file. */
	if(argc == 1)
	{
		printf("Please specify a file.\n");
		return 1;
	}
	
	/* Open the file. */
	FILE *input_file;
	input_file = fopen(argv[1], "r");
	
	/* Check if the file exists. */
	if(input_file == NULL)
	{
		printf("Invalid file.\n");
		return 1;
	}
	
	/* Run the lexical analyzer. */
	int lexreturn;
	lexreturn = lex(input_file);
	/* Close the file. */
	fclose(input_file);
	return lexreturn;
}

